<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/jquery.fullPage.css"/>
		<script src="js/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jquery.fullPage.min.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			*{
				padding: 0;
				margin: 0;
			}
			div{
				width: 200px;
				height: 200px;
				background-color: skyblue;
				transition: all .5s ease-in-out; 
			}
			.red{
				background-color: red;
			}
		</style>
	</head>
	<body>
		
		<div class="div">		
		</div>
		
		<div class="div melon liang zhizhi">		
		</div>
		
		
		<script type="text/javascript">
			//获取类名===添加
			// querySelector：q+8,从页面获取对象
			var div = document.querySelector(".div:nth-of-type(2)");
			//点击事件
			div.addEventListener("mouseover",function(){
				//要做的事情，方法写
				//classList打印类名
				console.log(div.classList);
				div.classList.add("red");
			})
			div.addEventListener("mouseout",function(){
				//remove鼠标移除
				div.classList.remove("red");
			})
		</script>
	</body>
</html>
